package co.yixiang.yshop.module.crm.controller.admin.crmclues.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "管理后台 - 线索 Response VO")
@Data
@ExcelIgnoreUnannotated
public class CrmCluesRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11763")
    @ExcelProperty("ID")
    private Long id;

    @Schema(description = "渠道来源")
    @ExcelProperty("渠道来源")
    private String channelSource;

    @Schema(description = "手机", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("手机")
    private String mobile;

    @Schema(description = "性别")
    @ExcelProperty("性别")
    private String sex;

    @Schema(description = "年龄")
    @ExcelProperty("年龄")
    private String age;

    @Schema(description = "城市地区")
    @ExcelProperty(value = "城市地区")
    private String areaInfo;

    @Schema(description = "学历")
    @ExcelProperty("学历")
    private String education;

    @Schema(description = "收入")
    @ExcelProperty("收入")
    private String income;

    @Schema(description = "创建时间")
    @ExcelProperty("创建时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "分配时间")
    @ExcelProperty("分配时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime assignTime;

    @Schema(description = "最后跟进时间")
    @ExcelProperty("最后跟进时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime followTime;

    @Schema(description = "负责人", requiredMode = Schema.RequiredMode.REQUIRED, example = "13269")
    @ExcelProperty("负责人")
    private String ownUserName;

    // These fields are needed for computation but not directly exported
    @ExcelIgnore
    @Schema(description = "负责人ID")
    private Long ownerUserId;

    @ExcelIgnore
    @Schema(description = "省份id")
    private Integer province;

    @ExcelIgnore
    @Schema(description = "城市ID")
    private Integer city;

    @ExcelIgnore
    @Schema(description = "区域ID")
    private Integer area;

    @ExcelIgnore
    @Schema(description = "原始负责人ID")
    private Long ownerId;

    // 导出需要的字段 - 移除@ExcelIgnore注解
    private String name;
    private String telephone;
    private Integer status;
    private Long customerId;
    private LocalDateTime changeTime;
    private Integer level;
    private Integer industry;
    private String tags;
    private Integer source;
    private String remark;
    private String detailAddress;
    private LocalDateTime nextTime;
    private LocalDateTime collectTime;
    private Integer followStatus;
    private String createName;
    private String married;
    private Double height;
    private Double weight;
    private String remarks;
    private LocalDateTime registerTime;
    private String updater;
    private LocalDateTime updateTime;
    private String creator;
    private Boolean deleted;
    private Long tenantId;
    private String followRecords;
    private String userName;
    private String dealStatus;
    private String cluesLevel;
    private String wechat;
    private String qq;

    /**
     * 获取区域信息的方法 - 将省市区编码转换为可读的地区信息
     * 
     * @return 格式化后的地区信息
     */
    public String getAreaInfo() {
        return areaInfo;
    }

    /**
     * 设置区域信息字段 - 此方法在导出前由控制器调用
     */
    public void setAreaInfo(String areaInfo) {
        this.areaInfo = areaInfo;
    }
}